package org.timemachine.context;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class Context {

	
	private Date changeTimeStamp= new Date();
	private boolean isLaterDate=false;

	private Map<String, Object> map = new HashMap<String, Object>();

	public Context() {
	}

	public void put(String key, Object value) {
		map.put(key, value);
	}

	public Object get(String key) {
		return map.get(key);
	}

	public Set<String> getKeySet() {
		return map.keySet();
	}

	public Set<Entry<String, Object>> getEntrySet() {
		return map.entrySet();
	}

	public void clearContext() {
		map.clear();
	}

	public boolean isContextEmpty() {
		if (map != null && map.size() == 0) {
			return true;
		} else {
			return false;
		}
	}

	public boolean isLaterDate() {
		return isLaterDate;
	}

	public void setLaterDate(boolean isLaterDate) {
		this.isLaterDate = isLaterDate;
	}

	public Map<String, Object> getMap() {
		return map;
	}

	public void setMap(Map<String, Object> map) {
		this.map = map;
	}

	public Date getChangeTimeStamp() {
		return changeTimeStamp;
	}

	public void setChangeTimeStamp(Date changeTimeStamp) {
		this.changeTimeStamp = changeTimeStamp;
	}
}
